package com.markerhub.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.markerhub.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * Mapper 接口
 *
 * @author MaXiaofeng
 * @since 2022-1-28
 */
@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {
    /**
     * 根据用户手机号获取用户id
     *
     * @param phone
     * @return
     */
    public int selectUserIdByPhone(@Param("phone") String phone);

    /**
     * 通过userId来查询对应数据更改用户手机号
     *
     * @param userId
     * @param phone
     * @return
     */
    public int updateUserByPhone(@Param("userId") int userId, @Param("phone") String phone);
}
